/*
 * backup.h
 *
 *  Created on: 07-06-2012
 *      Author: Mateusz Matrejek
 */
#include <sys/socket.h>
#include <netinet/in.h>
#include <time.h>
#include <sys/types.h>
#include <pthread.h>

#ifndef BACKUP_H_
#define BACKUP_H_

#define MAX_PASSWD_LENGTH 32
#define MAX_NAME_LENGTH 100
#define MAX_PATH_LENGTH 4096
#define MAX_CLIENTS 10
#define MAX_DIR_ELEMENTS 50000
#define MAX_HOSTNAME 255

#define TRUE 1
#define FALSE 0

//flags for file
#define DELETED -1
#define OK 0
#define FREE 1

struct Configuration{
      int port;
      char name[MAX_NAME_LENGTH];
      char server_path[MAX_PATH_LENGTH];
      char history_path[MAX_PATH_LENGTH];
      int update_interval;
      char passphrase[MAX_PASSWD_LENGTH];
};

struct ClientConfiguration{
      int port;
      char name[MAX_NAME_LENGTH];
      char serverHost[MAX_HOSTNAME];
      char path[MAX_PATH_LENGTH];
      int update_interval;
      char passphrase[MAX_PASSWD_LENGTH];
};

struct Client{
      int id;
      char name[MAX_NAME_LENGTH];
      int socket;
      struct sockaddr_in address;
      pthread_t listenThread;
      int active;
};

#endif /* BACKUP_H_ */
